﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace  LINQToolKit.Douban.Entities
{
    public class Event : EntityBase
    {
        private const string INVITEONLY_KEY = "invite_only";
        private const string CANINVITE_KEY = "can_invite";
        private const string PARTICIPANTS_KEY = "participants";
        private const string WISHERS_KEY = "wishers";

        public AssociationRef<People> Author { get; set; }
        public Location Location { get; set; }
        public TimeDuration Duration { get; set; }
        public string Where { get; set; }
        public AssociationSet<People> Participants { get; set; }
        public AssociationSet<People> Wishers { get; set; }
        public string Category { get; set; }

        public bool IsInviteOnly
        {
            get
            {
                return Convert.ToBoolean(base.GetAttribute(INVITEONLY_KEY));
            }
            set { base.SetAttribute(INVITEONLY_KEY, value.ToString()); }
        }

        public bool CanInvite
        {
            get
            {
                return Convert.ToBoolean(base.GetAttribute(CANINVITE_KEY));
            }
            set { base.SetAttribute(CANINVITE_KEY, value.ToString()); }
        }
    }
}
